<template>
	<view class="box">
		<image class="status-img" :src="type==1?'https://oss.jxhecong.com/v2/image/pay_pic_OK@2x.png':'https://oss.jxhecong.com/v2/image/pay_pic_lose@2x.png'"></image>
		<view class="tip">{{type==1?'充值成功':'充值失败'}}</view>
		<view class="konow" @click.stop="back">{{type==1?'知道了':'重新充值'}}</view>
		<view class="backhome" @click.stop="back_home">返回首页</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				type:1,
				from:''
			}
		},
		onLoad(options) {
			this.type=options.type
			this.from=options.from
			// #ifdef APP-PLUS
			let currentWebview = this.$mp.page.$getAppWebview() //获取当前页面的webview对象
			currentWebview.setStyle({ popGesture: 'none' })
			// #endif
		},
		methods:{
			back_home(){
				uni.navigateBack({
					delta:10
				})
			},
			back(){
				if(this.from=='charge'){
					uni.navigateBack({
						delta:1
					})
				} else {
					if(this.type == 1){
						uni.navigateBack({
							delta:2
						})
					}else if(this.type == 0){
						uni.navigateBack({
							delta:1
						})
					}
				}
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color: white;
	}
	.box{
		padding: 15px;
		padding-top: 200px;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
	.status-img{
		margin-top: 40px;
		width: 54px;
		height: 54px;
	}
	.tip{
		margin-top: 27px;
		color: #333333;
		font-size: 18px;
	}
	.konow{
		margin-top: 72px;
		height: 45px;
		width:calc(100% - 60rpx);
		line-height: 45px;
		color: white;
		font-size: 16px;
		text-align: center;
		background: #6ABF6C;
		border-radius: 45px;
	}
	
	.backhome{
		margin-top: 27px;
		color: #6ABF6C;
		font-size: 14px;
	}
</style>
